package com.sensen;

import com.sensen.listener.InitListener;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableAutoConfiguration
public class SimpledeomApplication {

	/**
	 * 注册监听器
	 * @return
	 */
	@Bean
	@SuppressWarnings({"rawtype","unchecked"})
	public ServletListenerRegistrationBean servletListenerRegistrationBean(){
		ServletListenerRegistrationBean servletListenerRegistrationBean =
				new ServletListenerRegistrationBean();
		servletListenerRegistrationBean.setListener(new InitListener());
		return servletListenerRegistrationBean;
	}



	public static void main(String[] args) {
		SpringApplication.run(SimpledeomApplication.class, args);
	}
}
